#ifndef CAMERAOBJECT_H_INCLUDED
#define CAMERAOBJECT_H_INCLUDED

//includes
#include <ObjectSubSystem/BaseCameraObject.h>
#include <RenderSubSystem/cvIRender.h>
#include <RenderSubSystem/cvImmediateModeRenderer.h>

namespace cvImmediateModeRenderer
{

	/**
	 *	IMCameraObject.
	 */
	class IMCameraObject : public cvObjects::BaseCameraObject
	{
		public:
			/** ### ObjectSubSystem perspective ### */

			/** Construct a IMMCameraObject */
			static IMCameraObject * create();
			/// Creates a duplicate of the object.
			virtual IMCameraObject * copy( cvMath::bitfield_t flags );

			virtual void destroy();

			///	Camera coordinate mode.
			virtual void useWorldCoordinates();
			virtual void useScreenCoordinates();

			/** ### RenderSubSystem perspective ### */

			/// Setups camera
			virtual void setup();

			virtual cvMath::Rectf getBoundingBox();

		protected:
			IMCameraObject();
			~IMCameraObject();

			typedef void (IMCameraObject::*setup_fn)();
			void setup_screencoordinates();
			void setup_worldcoordinates();
			setup_fn fn_setup;


		private:
			// Camera objects do not use pooling...
			void * operator new[](size_t dummy)	{ throw; }
			void operator delete[](void * ptr)	{ throw; }

			cvMath::Mat4x4f m_bbtransfrom;

	};


};

#endif // CAMERAOBJECT_H_INCLUDED
